package com.cc.controller;

import com.cc.com.Page;
import com.cc.entity.Book;
import com.cc.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController //Controller + ResponseBody
@RequestMapping("/book")
@CrossOrigin
public class BookController {
    @Autowired
    private BookService bookService;
    /**
     * 获取图书列表
     * @param bookName
     * @param author
     * @return
     */
    @RequestMapping("/page")
    public Page<Book> getBookPage(String bookName, String author, Integer pageNum, Integer pageSize) {
        return bookService.getBookPage(bookName, author, pageNum, pageSize);
    }

}
